<template>
  <div class="infoNav-containner">
    <el-row :gutter="20" class="seachnav">
      <el-col :xs="7" :sm="6" :md="4" :lg="6" :xl="4">
        <span><router-link  :to="{path:'/monitor'}"><img :src="returnnormalpress" class="returnnormalpress"/></router-link></span>
        <span><img :src="realtimeindex" class="equiplist"/></span>
        <span class="description">监控</span>
      </el-col>
      <el-col :xs="7" :sm="6" :md="18" :lg="18" :xl="21" class="con" >
      </el-col>
    </el-row>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="工程配置" name="first">
        <div class="viewContent">
          <el-row :gutter="24">
            <el-col :span="24">
              <div class="grid-content bg-purple">
               <configuration-table ref="firstnum"></configuration-table>
              </div>
            </el-col>
          </el-row>
        </div>
      </el-tab-pane>
      <!-- 暂时屏蔽 请勿删除
      <el-tab-pane label="心跳配置" name="second">
        <div class="viewContent">
          <el-row :gutter="20">
            <el-col :span="4">
              <div class="grid-content bg-purple">
              </div>
            </el-col>
            <el-col :span="20">
              <div class="grid-content bg-purple">
              </div>
            </el-col>
          </el-row>
        </div>
      </el-tab-pane>
  -->
      <el-tab-pane label="安全时段" name="third">
        <div class="viewContent">
          <el-row class="alarmRow">
            <el-col :span="25" class="alarmCol">
              <div class="grid-content bg-purple">
                <safe-record ref="thirdnum"></safe-record>
              </div>
            </el-col>
          </el-row>
        </div>
      </el-tab-pane>
      <el-tab-pane label="联动配置" name="fourth">
        <div class="viewContent">
          <el-row class="alarmRow">
            <el-col :span="25" class="alarmCol">
              <div class="grid-content bg-purple">
                <linkage-record ref="fourthnum" ></linkage-record>
              </div>
            </el-col>
          </el-row>
        </div>
      </el-tab-pane>
      <el-tab-pane label="告警发送策略" name="five">
        <div class="viewContent">
          <el-row class="alarmRow">
            <el-col :span="25" class="alarmCol">
              <div class="grid-content bg-purple">
                <strategyRecord ref="fivenum"></strategyRecord>
              </div>
            </el-col>
          </el-row>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
  import configurationTable from './configurationTable'
  //  import rightTable from './queryInfoTable'
  //  import searchTable from './dataSearchTable'
  import realtimeindex from '@/assets/home/realtimeindex.png'
  import returnnormalpress from '@/assets/equipv2/returnnormalpress.png'
  import safeRecord from '../safeTime/index'
  import linkageRecord from '../linkageEquipment/index'
  import strategyRecord from '../sendingStrategy/index'

  export default {
    name: 'queryInfonav',
    components: { configurationTable, safeRecord, linkageRecord, strategyRecord },
    data() {
      return {
        activeName: 'first',
        firstTable: 0,
        secondTable: 1,
        realtimeindex,
        returnnormalpress
      }
    },
    methods: {
      handleClick(tab, event) {
        if (this.activeName === 'first') {
          this.$refs.firstnum.engineData()
        } else if (this.activeName === 'third') {
          this.$refs.thirdnum.getSafeList()
        } else if (this.activeName === 'fourth') {
          this.$refs.fourthnum.getLinkageList()
        } else if (this.activeName === 'five') {
          this.$refs.fivenum.overSendingStrategy()
        }
      }
    }
  }

</script>
<style rel="stylesheet/scss" lang="scss" scoped>
  .infoNav-containner{
    width: 100%;
    height: 50px;
    font-size: 20px;
    color: #0072F3;
    background-color: #ffffff;
    .seachnav{
      width: 60%;
      height: 50px;
      position: fixed;
      z-index: 2;
      top:0;
      bottom: 0;
      line-height: 55px;
      padding-left: 0px;
      .description{
        font-size: 18px;
        color: #333;
        line-height: 10px;
        padding-left: 10px;
      }
      .returnnormalpress{
        vertical-align: middle;
        /*cursor: pointer;*/
      }
      .equiplist{
        vertical-align: middle;
        margin-left: 10px;
      }
      .searchinvalid{
        vertical-align: middle;
        cursor: pointer;
      }
      .con{
        width: 85%;
        height: 50px;
        float: right;
        margin-right: 20px;
        line-height: 3px;
        padding-left: 0 !important;
        .seachContent{
          font-size:18px;
          font-family:MicrosoftYaHei;
          font-weight:400;
          padding-top: 0px;
          color:rgba(51,51,51,1);
        }
        .seachtitle{
          font-size:12px;
          font-family:MicrosoftYaHei;
          font-weight:400;
          color:rgba(102,102,102,1);
        }
      }
    }
  }
  .viewContent{
    width: 100%;
    height: 40vw;
    /*border: 1px solid red;*/
  }
  /*改变tab颜色*/
  .el-tabs__item:hover {
    color: #0072F3;
    cursor: pointer;
  }
  .el-tabs__item.is-active {
    color: #0072F3;
    background-color: #ffffff;
  }
  .el-tabs__active-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: #0072F3;
    z-index: 1;
    -webkit-transition: -webkit-transform .3s cubic-bezier(.645,.045,.355,1);
    transition: -webkit-transform .3s cubic-bezier(.645,.045,.355,1);
    transition: transform .3s cubic-bezier(.645,.045,.355,1);
    transition: transform .3s cubic-bezier(.645,.045,.355,1), -webkit-transform .3s cubic-bezier(.645,.045,.355,1);
    transition: transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);
    list-style: none;
  }
  .el-tabs__item {
    padding: 0 20px;
    height: 40px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    line-height: 40px;
    display: inline-block;
    list-style: none;
    font-size: 14px;
    font-weight: 500;
    color: #303133;
    text-align: center;
    position: relative;
  }

  .el-tabs__item.is-top:last-child {
    padding-right: 18px;
  }
  /************告警样式*************/
  .alarmRow{
    width: 100%;
  }
  .alarmCol{
    width: 100%;
  }
  /***************Tab组件颜色修改*****************/
  /deep/ .el-tabs__item:hover{
    color: #0072F3;
  }
  /deep/ .el-tabs__item.is-active{
    color: #0072F3;
    line-height: 50px;
  }
  /deep/ .el-tabs__active-bar{
    height: 4px;
    background-color: #0072F3;
  }
  /deep/ .el-tabs__nav{
    margin-left: 30px;
    height: 50px;
  }
  /deep/ .el-tabs__nav-wrap{
    height: 50px;
  }
  /deep/ .el-tabs__nav-wrap::after {
    height: 1px;
  }
</style>
